package main

import "fmt"

type GetSetter interface {
	get() int
	set(int)
}

type Int int

func (i *Int) get() int {
	return int(*i)
}

func (i *Int) set(h int) {
	*i = Int(h)
}

func getAndSet(x GetSetter) {
	fmt.Println(x.get())
	x.set(2)
}

func main() {
	x := new(Int)
	x.set(1)
	getAndSet(x)
	fmt.Println(x.get())
}